package com.fengycx.fallback;

import com.fengycx.feign.CustomerFineApi;
import com.fengycx.param.CustomerCancelOrderParam;
import com.fengycx.result.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CustomerApiFallbackFactory implements FallbackFactory<CustomerFineApi> {

    @Override
    public CustomerFineApi create(Throwable cause) {
        cause.printStackTrace();
        return new CustomerFineApi() {
            @Override
            public R<Void> customerCancelOrder(CustomerCancelOrderParam param) {
                return null;
            }
        };
    }
}
